package com.itboye.allshengmedical.sci.packet.resp;

import android.os.SystemClock;
import android.util.Log;

import com.example.allshengmedical.experimentnew.view.IFileManagerView;

public class DetectLightIntensitTempRespPacket extends BaseRespPacket {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	BaseRespPacket packet;

	public DetectLightIntensitTempRespPacket(BaseRespPacket packet) {
		this.clone(packet);
		this.packet = packet;
		this.setExpectDataLength(97);
	}

	public int change(byte i) {
		if (i < 0) {
			i += 256;
		}
		return i & 0xff;
	}

	public String returnData() {
		String string = null;
		StringBuffer buffer = new StringBuffer();
		for (int i = 1; i <= 96; i += 3) {
			int lightNum = change(this.getContent(i)) * 256 * 256
					+ change(this.getContent(i + 1)) * 256
					+ change(this.getContent(i + 2));
			buffer.append(lightNum + ",");
			SystemClock.sleep(1);
		}
		Log.e("hjy   return date", "return date" + buffer.toString());
		string = buffer.toString();
		buffer = null;
		return string;

	}
}
